package com.zhengsr.drawbroad;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.zhengsr.drawbroad.state.PenAction;
import com.zhengsr.drawbroad.view.DrawView;

public class MainActivity extends AppCompatActivity {
    private DrawView mDrawView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mDrawView = findViewById(R.id.drawview);
    }

    public void paintcolor(View view) {
        mDrawView.setCurrentState(PenAction.create());
    }

    public void undo(View view) {
        mDrawView.undo();
    }

    public void clear(View view) {
        mDrawView.clear();
    }

    public void redo(View view) {
       // mDrawView.redo();
    }

    public void eraser(View view) {
        //mDrawView.setEraser(2);
    }
}
